// console.log('ok')
import Vue from 'vue'

import VueRouter from 'vue-router'
Vue.use(VueRouter)

//导入格式化时间的插件 cnmp i moment -S
import moment from 'moment'
//定义全局过滤器
Vue.filter('dataFormat',function(dataStr,patten = 'YYYY-MM_DD HH:mm:ss'){
    moment(dataStr),formate(patten)
})

//按需导入Mint-UI中的组件
import { Header,Swipe, SwipeItem,Button } from 'mint-ui';
Vue.component(Header.name,Header);
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Button.name,Button);
import 'mint-ui/lib/style.css'

//导入vue-resource
import VueResource from 'vue-resource'
Vue.use(VueResource)
//设置请求的根路径
Vue.http.options.root = '/root';

import router from './router.js'


//导入MUI的样式
import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'

import app from './App.vue'

var vm = new Vue({
    el:'#app',
    render:c=>c(app),
    //挂载路由对象到vm实例上
    router
})